home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / stdarg.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  1.2 KB  |  55 lines

  1. /*  stdarg.h
  2.  
  3.     Definitions for accessing parameters in functions that accept
  4.     a variable number of arguments.
  5.  
  6. */
  7.  
  8. /*
  9.  *      C/C++ Run Time Library - Version 9.0
  10.  *
  11.  *      Copyright (c) 1987, 1998 by Borland International
  12.  *      All Rights Reserved.
  13.  *
  14.  */
  15. /* $Revision:   9.2  $ */
  16.  
  17. #ifndef __STDARG_H
  18. #define __STDARG_H
  19. #define _INC_STDARG  /* MSC Guard name */
  20.  
  21. #ifdef __VARARGS_H
  22. #error Can't include both STDARG.H and VARARGS.H
  23. #endif
  24.  
  25. #ifndef ___STDDEF_H
  26. #include <_stddef.h>
  27. #endif
  28.  
  29. #ifdef __cplusplus
  30. namespace std {
  31. #endif /* __cplusplus */
  32.  
  33. typedef void _FAR *va_list;
  34.  
  35. #define __size(x) ((sizeof(x)+sizeof(int)-1) & ~(sizeof(int)-1))
  36.  
  37. #define va_start(ap, parmN) ((void)((ap) = (va_list)((char _FAR *)(&parmN)+__size(parmN))))
  38. #define va_arg(ap, type) (*(type _FAR *)(((*(char _FAR *_FAR *)&(ap))+=__size(type))-(__size(type))))
  39. #define va_end(ap)          ((void)0)
  40.  
  41. #if !defined(__STDC__)
  42. #define _va_ptr             (...)
  43. #endif
  44.  
  45. #ifdef __cplusplus
  46. } // std
  47. #endif /* __cplusplus */
  48.  
  49. #endif  /* __STDARG_H */
  50.  
  51. #if defined(__cplusplus) && !defined(__USING_CNAME__) && !defined(__STDARG_H_USING_LIST)
  52. #define __STDARG_H_USING_LIST
  53.      using std::va_list;
  54. #endif /* __USING_CNAME__ */
  55.